package com.spt.springbootzhsx.service.suggest.Get_UserToMovieList_1;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class GetUTM_Mapper extends Mapper<LongWritable, Text, Text, Text>{
    private Text outK = new Text();
    private Text outV = new Text();

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String[] line = value.toString().split("\\t");
        outK.set(line[0]);   //用户id
        outV.set(line[1]);   //电影id
        context.write(outK, outV);
    }
}
